﻿using System.Configuration;
using System.Web.Mvc;

namespace FrameWork.Util.Http
{
    public static class HtmlHelperExtend
    {
        /// <summary>
        /// 给CSS文件或JS文件指定版本号
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="url">CSS或JS路径</param>
        public static string GetCssJsUrl(this HtmlHelper helper, string url)
        {
            var version = ConfigurationManager.AppSettings["JsVersion"];
            version = version ?? "1.0";
            url += "?v=" + version;
            return url;
        }
    }
}